home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk7 / rxutil / readme < prev    next >
Text File  |  1995-03-18  |  7KB  |  170 lines

  1. This archive contains a few example ARexx programs. A few of them might
  2. even be useful to you.
  3. ----------------------------------------------------------------------------
  4. Notes: These programs assume that the ARexx support library has been
  5.        opened. I open it in my startup-sequence because I use ARexx a lot.
  6.  
  7.        On my system, 'delete' is called 'del'. If it isn't called that on
  8.        your system, just change any occurences of 'del' to whatever you
  9.        call it on your system.
  10.  
  11.        Many of these programs are tools I use often. Since I don't like
  12.        typing 'rx' before them, I use WShell. I highly recommend it.
  13. ----------------------------------------------------------------------------
  14. The programs:
  15.  
  16. join.rexx
  17. ----------
  18.   The standard Amigados JOIN command has a small problem. If the output
  19. file is the same name as one of the input files, JOIN will complain, and
  20. will even wipe out that file, leaving it empty. join.rexx fixes this  by
  21. detecting whether the above condition is met, and if it is, changes the
  22. command line to make the output a file called 'arexxtempfile', calling the
  23. Amigados JOIN with it, then copying the temp file to the real output file
  24. name, and deleting the temp file.
  25.  
  26. append.rexx
  27. -----------
  28. Syntax: append a b c
  29.  
  30.   A special case of JOIN. In the above example, will JOIN files named a, b,
  31. and c. The resulting joined file will be named 'a'. It does its work by
  32. adding 'AS' and the first filename in the command line to the end of the
  33. command line and calling join.rexx
  34.  
  35. copy.rexx
  36. ---------
  37.   This was written to do a job for me. It also serves as an example of how
  38. to modify a command by placing an appropriately named file in the REXX:
  39. directory. If you are using WShell, the REXX: directory is searched before
  40. the C: directory when you type a command. If the file is found, it will be
  41. executed as an ARexx script, allowing you to do anything you want with the
  42. command line before calling the actual program. In this case, copy.rexx
  43. lets me use the '*' wildcard. it performs its function by replacing all
  44. instances of '*' with '#?'.
  45.  
  46. man.rexx
  47. --------
  48.   Similar to the Unix 'man', this allows you to have online documentation
  49. files. In my case, I have an assigned directory called 'DOCS:', and within
  50. that directory, a number of text files that end with '.doc'. This program
  51. finds the appropriate one and uses 'more' to display it. You could have it
  52. call your favourite editor, or just type the file out to the console.
  53.  
  54. plot.rexx
  55. ---------
  56.   This one is by Rick Morris of Vancouver BC. It is rather specialized, but
  57. fascinating because it shows the power of ARexx in non-trivial programs.
  58. It will accept a PCLO 'BLOCK' file, and plot it double sized on a Toshiba
  59. P351 printer (24 pin, impact, dot matrix). You can probably modify it for
  60. any other printer, though best results will be obtained with 24 pins or
  61. on a laser printer. PCLO is a printed circuit board CAD program from
  62. SoftCircuits.
  63.  
  64. touch.rexx
  65. ----------
  66.   Sets the date on a file to the current date and time. Setdate is normally
  67. used for this, and in fact is called by touch.rexx to do its thing. The
  68. difference here is that if the file does not exist, it will be created as
  69. an empty file. Handy for those programs that require a file of a certain
  70. name, but aren't smart enough to create one.
  71.  
  72. arcall.rexx
  73. -----------
  74.   A program that will ARC all files within a directory, including
  75. subdirectories.  It will rename all files to the form 'File1', 'File2',
  76. etc.  and will generate a standard Amigados script file that will be
  77. included in the .ARC file.  This script file, when executed, recreates the
  78. original file structure, creating any necessary subdirectories and renaming
  79. all files back to their original names. Written at the request of the sysop
  80. of the Panorama BBS in Vancouver BC.
  81.  
  82. ports.rexx
  83. ports2.rexx
  84. -----------
  85.   Two examples (not at all useful) of interprocess communication. To use,
  86. open a second CLI, and run 'ports' in one of them. It will print a message
  87. and wait. When you run 'ports2' in the other CLI, it will send a message to
  88. 'ports'. When 'ports' receives the message, it will print it and exit.
  89. ---------------------------------------------------------------------------
  90.  
  91. Use the code in these programs in any way you see fit. If you have examples
  92. of your own ARexx programs, I and many others would like to see them.
  93.  
  94. Larry Phillips.
  95.     Compuserve: 76703,4322
  96.  
  97. ============================================================================
  98. ============================================================================
  99.  
  100.  
  101. sizeblk.rexx
  102. ------------
  103.  
  104. From: daveh@cbmvax.UUCP (Dave Haynie)
  105. Subject: Re: ARexx Questions
  106. Date: 29 Jun 88 00:02:16 GMT
  107. Organization: Commodore Technology, West Chester, PA
  108.  
  109.  
  110. In article <2119@cadovax.UUCP>, kaz@cadovax.UUCP (Kerry Zimmerman) says:
  111. > After reading so many glowing words about ARexx here on the net ...
  112. >
  113. > Why would I want to write a script in ARexx, instead of using a CLI script
  114. > or a Shell script (using Matt's Shell)?
  115.  
  116. I don't recall the examples on the ARexx disk offhand.  But there are lots
  117. of things you can't do easily, or possibly at all, using the CLI script
  118. language, or probably Matt's shell language (tough I haven't used it
  119. myself).  One of the features I like the most about the ARexx language
  120. is that it supports recursive subroutines, like any REAL computer language.
  121.  
  122. Consider, for a moment, this problem.  I've got gobs of stuff on my
  123. hard disk, all kinds of directories filled with Usenet downloads.  I
  124. like to transfer whole directories over to floppy disks.  I waste lots
  125. of time if I try to transfer a directory and find out that it won't
  126. fit on the space remaining on a floppy.  So I want a function that'll
  127. tell me the size, in blocks, of a directory tree.
  128.  
  129. Here's an ARexx solution, written in about 10 minutes.
  130.  
  131.  
  132. > No advantage is gained using ARexx over the CLI or Shell to communicate
  133. > with DOS that I know of.
  134.  
  135. I'd be interested in seeing this done with CLI Scripts.  You could certainly
  136. write a C program to do this, but it would be longer, and it would probably
  137. take more than 10 minutes to write.  I guess it would be faster, too, but
  138. this is just an example.
  139.  
  140.  
  141. > Kerry Zimmerman
  142. > #  {ucbvax,decvax}!trwrb!cadovax!kaz  Contel Business Systems 213-323-8170
  143. > A difference between an amateur and a professional, is that a professional
  144. > has the right tools.
  145.  
  146. --
  147. Dave Haynie  "The 32 Bit Guy"     Commodore-Amiga  "The Crew That Never Rests"
  148.    {ihnp4|uunet|rutgers}!cbmvax!daveh      PLINK: D-DAVE H     BIX: hazy
  149.                 "I can't relax, 'cause I'm a Boinger!"
  150.  
  151. ============================================================================
  152.  
  153. bugs for sizeblk.rexx
  154. ---------------------
  155.  
  156. I had to add a call to addlib() up at the top to open the rexxsupport.library,
  157. which is where showdir() lives.  Also changed to format of the output results.
  158.  
  159. Doesn't handle multiple directories from the command line.
  160.  
  161. No check to insure input arg is really a dir ... just gives 0 blocks if it's
  162. a single file.
  163.  
  164. Doesn't (cleanly) handle a non-existent dir as input arg ... relys on ARexx
  165. error message.
  166.  
  167. If no directory name given on the command line, gives the block count of the
  168. current dir, but does NOT print it's name in the output.
  169.  
  170.